package org.example.stream.demo;

import org.example.stream.demo.entity.User;

import java.util.List;

public class MapIntMain {
    public static void main(String[] args) {
        List<User> list = UserBuilder.bindings();

        int res1 = list.stream().mapToInt(User::getAge).min().orElse(0);
        int res2 = list.stream().mapToInt(User::getAge).max().orElse(0);
        int res3 = list.stream().mapToInt(User::getAge).sum();
        System.out.println(res1);
        System.out.println(res2);
        System.out.println(res3);
    }
}
